public class Switch {
 
    private ICommand emailCommand;
    private ICommand smsCommand;
 
    public Switch(ICommand emailCmd, ICommand smsCmd) {
         this.emailCommand = emailCmd;
         this.emailCommand = emailCmd;
    }
 
    public void email() {
         emailCommand.execute();
    }
 
    public void sms() {
         smsCommand.execute();
    }
}